import dayjs from 'dayjs';

export const dateRangeArr = [
  {
    text: '近一周',
    value: () => {
      const end = dayjs();
      const start = end.subtract(7, 'day');
      return [start, end];
    },
  },
  {
    text: '近一月',
    value: () => {
      const end = dayjs();
      const start = end.subtract(1, 'month');
      return [start, end];
    },
  },
  {
    text: '近三月',
    value: () => {
      const end = dayjs().startOf('day');
      const start = end.subtract(3, 'month');
      return [start, end];
    },
  },
  {
    text: '近半年',
    value: () => {
      const end = dayjs().startOf('day');
      const start = end.subtract(6, 'month');
      return [start, end];
    },
  },
  {
    text: '近一年',
    value: () => {
      const end = dayjs().startOf('day');
      const start = end.subtract(1, 'year');
      return [start, end];
    },
  },
  {
    text: '下一年',
    value: () => {
      const start = dayjs().startOf('day');
      const end = start.add(1, 'year');
      return [start, end];
    },
  },
];